package TreeSet1;

import lombok.Data;

@Data
public class Student implements Comparable<Student>{
    String name;
    int age;
    Student(String n ,int a){
        name = n;
        age = a;
    }


    @Override
    public int compareTo(Student o) {
        int res =   this.age - o.age;
        return res == 0? this.name.compareTo(o.name):res;
    }
}
